home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-03 / qbasicpg.zip / CHR_EX.BAS < prev    next >
BASIC Source File  |  1988-09-17  |  999b  |  32 lines

  1. ' *** CHR_EX.BAS ***
  2. '
  3. DEFINT A-Z
  4. ' Display two double-sided boxes.
  5. CALL DBox(5,22,18,40)
  6. CALL DBox(1,4,4,50)
  7. END
  8.  
  9. ' Subroutine to display boxes.
  10. ' Parameters:
  11. '  Urow%, Ucol% : Row and column of upper-left corner.
  12. '  Lrow%, Lcol% : Row and column of lower-right corner.
  13. '  Constants for extended ASCII graphic characters.
  14. CONST ULEFTC=201, URIGHTC=187, VERTICAL=186, HORIZONTAL=205
  15. CONST LLEFTC=200, LRIGHTC=188
  16.  
  17. SUB DBox (Urow%, Ucol%, Lrow%, Lcol%) STATIC
  18.    ' Draw top of box.
  19.    LOCATE Urow%, Ucol% : PRINT CHR$(ULEFTC);
  20.    LOCATE ,Ucol%+1 : PRINT STRING$(Lcol%-Ucol%,CHR$(HORIZONTAL));
  21.    LOCATE ,Lcol% : PRINT CHR$(URIGHTC);
  22.    ' Draw body of box.
  23.    FOR I=Urow%+1 TO Lrow%-1
  24.       LOCATE I,Ucol% : PRINT CHR$(VERTICAL);
  25.       LOCATE  ,Lcol% : PRINT CHR$(VERTICAL);
  26.    NEXT I
  27.    ' Draw bottom of box.
  28.    LOCATE Lrow%, Ucol% : PRINT CHR$(LLEFTC);
  29.    LOCATE ,Ucol%+1 : PRINT STRING$(Lcol%-Ucol%,CHR$(HORIZONTAL));
  30.    LOCATE ,Lcol% : PRINT CHR$(LRIGHTC);
  31. END SUB
  32.